﻿using System.Xml.Linq;

namespace Sidvall.Serialization
{
    public interface ISerializer
    {
        object Deserialize(string value);
        object Deserialize(string value, SerializerSettings settings);

        XDocument DeserializeXml(string value, string deserializeRootElementName, bool writeArrayAttribute);

        T Deserialize<T>(string value);
        T Deserialize<T>(string value, SerializerSettings settings);
        T TryDeserialize<T>(string value, System.Func<T> getDefaultValueHandler);
        T TryDeserialize<T>(string value, System.Func<T> getDefaultValueHandler, SerializerSettings settings);

        string Serialize(object value);
        string Serialize(object value, SerializerSettings settings);

        string SerializeXml(XNode node, bool omitRootObject, SerializerSettings settings);
    }
}
